package com.syl.web.controller;

import com.syl.pojo.User;
import com.syl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/user.html.")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping(params = "act=add")
    public Map<String,Object> add(User user){
        userService.addUser(user);
        Map<String,Object> result = new HashMap<>();
        result.put("添加成功",null);
        return result;

    }

}
